from aiogram import Bot, Router
from aiogram.filters import Command
from aiogram.types import Message

from filters import IsAdmin
from utils import alert_admin, debugger, delete_message, log

router = Router()

@router.message(Command('admin'), IsAdmin())
async def _get_cmd_start(message: Message, bot:Bot):
  debugger.debug(f"/admin {message.from_user.full_name}")
  await delete_message(bot, message)
  await message.answer("Административный раздел")

@router.message(Command('admin'), ~IsAdmin())
async def _get_cmd_start(message: Message, bot:Bot):
  log.warning(f"/admin DENIED @{message.from_user.username}")
  await delete_message(bot, message)
  await alert_admin(bot, f"Пользователь @{message.from_user.username} ломится в админку")
